package com.changanw.spring_spred.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @description:
 * @author: changanw
 * @createTime:2021/12/20 12:29
 */
@Service
public class UserService {
  @Autowired
  JdbcTemplate jdbcTemplate;
  @Autowired
  UserService2 userService2;

  //@Transactional
  public void transfer(){
    jdbcTemplate.update("update user set money = ? where username = ?;",1000,"zhangsan");
    userService2.transfer2();
    //int i = 1 / 0;
  }

}
